In the related art, as disclosed in PTL 1, an imaging element for a template image (reference image) has sensitivity on a longer wavelength side than an imaging element for a searched image (comparison image) in calculation of a distance image; three-dimensional information of an object is calculated by using a function which defines a relationship between focal length information or aberration information and a wavelength component; and three-dimensional measurement accuracy is prevented from deteriorating due to variations in a focal length, an aberration characteristic, or the like for each wavelength in a wide wavelength band.